<{include file="section/admin/admin_header.tpl"}>
<body>
<{include file="section/admin/admin_header_login_bar.tpl"}>

<div id="contentA" class="clear" style="width:1300px;">
	<!--leftsidebar sr-->
	<{include file="section/admin/admin_left_sidebar.tpl"}>
    <!--/leftsidebar end-->
    <div class="rightCont">
    	<!--path st-->
		<div class="path">您的位置：<a href="/">首页</a>&gt; 管理员列表</div>
		<!--/path end-->
    	<h2 class="title01"><span>管理员列表</span></h2>
        <div style="text-align:right;height:15px;font-size;18px;"><a href="/user/" >添加管理员</a></div>
        <div class="line1"></div>
		<!--box02 st-->
        <div class="box02">
            <div class="box02_1">
                <div class="search02 clear">
                	<form action="user/admin_list" id="frm_query" name="frm_query" method="post">
					<input type="hidden" value="query" name="action">
                    <!--
					<ul>
                    <li class="mr5"><input type="text" name="login_name" class="in2" onblur="this.className='in2';if(this.value=='') this.value='填写姓名或者账号';" onfocus="this.className='in1';if(this.value=='填写姓名或者账号') this.value='';" value="填写姓名或者账号" size="20" /></li>
					<li>
					<select name="privilege">
					<option value="">选择管理类别</option>
					<option value="0">运营人员</option>
                    <option value="1" onclick="">管理员</option>
                    <option value="2">超级管理员</option>
                    </select> <input type="submit" value="查询" class="btn01" /></li>
                    </ul>
          			-->
					</form>
                </div>
				
				<form id="frm_del" action="/user/admin_list" method="post">
				<input type="hidden" value="" name="login_name">
				<input type="hidden" value="del" name="action">
                <div class="box02_Tab">
                	<div class="table01">
                    	<table cellpadding="0" cellspacing="0" width="100%" border="0" id="table">
                        <tr class="th">
                        <th><div>&nbsp;</div></th>
                        <th><div class="tl">账号</div></th>
                        <th><div>姓名</div></th>
                        <th><div>手机</div></th>
                        <th><div>权限等级</div></th>
                        <th>操作</th>
                        </tr>

						<{foreach from=$data key=key item=item}>
						<tr>
                        <td><input name="u_<{$item.uid}>" type="checkbox" value="1" onclick="select_one(this);"/></td>
						<td class="tl"><{$item.passport}></td>
                        <td><{$item.realname}></td>
						<td><{$item.mobile}></td>
						<td><{$item.role_name}></td>
						<td><a href="/user/admin_data/<{$item.uid}>" target="_blank">修改</a></td>
                        </tr>
						<{/foreach}>

                        </table>
                    </div>
                </div>
                <div class="box02_lab clear">
                    <ul>
                    <li class="i1"><input name="chk_all" type="checkbox" value="0" onclick="select_all(this);" /> <label>全选</label></li>
                    <li><div class="btn03 btn03_2"><span class="bg6"><a href="javascript:frm_del_submit();">删除</a></span></div></li>
                    </ul>
                </div>
				</form>
                <div class="page clear">
                	共计：<{$total}> &nbsp; <{$pagination}>
                </div>
            </div>
        </div>
        <!--/box02 end-->
        
    </div>
</div>
</body>
<script type="text/javascript">

var frm_query = document.getElementById('frm_query');
var frm_del = document.getElementById('frm_del');

frm_query.onsubmit = function ()
{
	with(this)
	{
		if(login_name.value == '填写姓名或者账号')
			login_name.value = '';
	}
}
frm_del.onsubmit = function ()
{
}

function frm_del_submit()
{
	with(frm_del)
	{
		if(login_name.value == '填写姓名或者账号')
			login_name.value = '';
	}
	var flag = 0;
	var str_chk = '';
	var chk = document.getElementsByTagName('input');
	for(var i=0;i<chk.length;i++)
	{
		if(chk[i].name.indexOf("u_") == 0)
		{
			if(chk[i].checked == true)
			{
				str_chk += chk[i].name;
			}
		}
	}
	if(str_chk.length == 0)
		ymPrompt.errorInfo('请至少选择一项！',null,null,'错误提示',function(){ymPrompt.close;});
	else
		ymPrompt.confirmInfo('确认要删除吗？',null,null,'询问',on_delete);
}
function on_delete(tp)
{
	if(tp=='ok'){
		frm_del.submit();
	}
	if(tp=='cancel'){
		ymPrompt.close();
	}
	if(tp=='close'){
		ymPrompt.close();
	}
}
function select_all(obj)
{
	if(obj.value == '0')
	{
		var chk = document.getElementsByTagName('input');
		for(var i=0;i<chk.length;i++)
		{
			if(chk[i].name.indexOf("u_") == 0)
			{
				chk[i].checked = true;
			}
		}
		obj.value = '1';
	}
	else
	{
		obj.checked = false;
		obj.value = '0';
	}
}
function select_one(obj)
{
	if(obj.checked == false)
	{
		frm_del.chk_all.checked = false;
		frm_del.chk_all.value = '0';
	}
}

</script>
</html>
